# #安装requests库
# #导入requests库
import requests
# r = requests.get("https://www.baidu.com/")
#
# # 返回状态码  200
# print(r.status_code)
#
# #打印返回的文本数据，html文本
# r.encoding = "UTF-8"
# print(r.text)

# 返回的数据为二进制数据,比如：文件  图片等
# print(r.content)

#打印当前访问的网址
# print(r.url)

#练习题
u = requests.get("http://192.168.110.248:8000")
u.encoding = "UTF-8"
print(u.text)
#练习题
l = requests.get("http://192.168.110.248:8000/get_name")
l.encoding = "UTF-8"
print(l.text)

#练习题 有参数的情况下
w = requests.get("http://192.168.110.248:8000/get_data?id=1&name=王大锤")
w.encoding = "UTF-8"
print(w.text)